const CryptoJS = require('crypto-js/crypto-js.js')

const key = CryptoJS.enc.Utf8.parse('c2d7cc26fe31c097')


export function Encrypt(password: any) {
  let srcs = CryptoJS.enc.Utf8.parse(password);
  let encrypted = CryptoJS.AES.encrypt(srcs, key, { mode:CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
  return encrypted.toString();
}

export function decryptByAES(message: any) {
  let decrypt = CryptoJS.AES.decrypt(message, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
  return CryptoJS.enc.Utf8.stringify(decrypt).toString();
}
